package com.zsck.pos.utils;

import java.io.UnsupportedEncodingException;
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
import cn.hutool.crypto.symmetric.SymmetricCrypto;

public class AESUtils {

    private final static String DEFAULT_AES_KEY = "aNmAgTVmssLvoeMm";
    /*AES加密*/
    public static String encrypt(String data) throws UnsupportedEncodingException {
        byte[] byteKey = DEFAULT_AES_KEY.getBytes("utf-8");
        SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, byteKey);
        return aes.encryptHex(data);
    }

}
